/**
 * 
 */
package t4j.strings;

import java.io.BufferedReader;
import java.io.StringReader;
import java.util.Scanner;

/**
 * @author sz
 *
 * create time：2012-11-29
 */
public class BetterRead {

	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new StringReader("Sir Robin of Camelot\n22 1.61803"));
		
		Scanner stdin = new Scanner(input);
		
		System.out.println("What is your name?");
		
	
		
		String name = stdin.nextLine();
		
		System.out.println(name);
		
		System.out.println("How lod are you?what is your favorite double?");
		
		System.out.println("(input: <age> <double>)");
		
		int age = stdin.nextInt();
		
		double favorite = stdin.nextDouble();
		
		System.out.format("Hi %s.\n", name);
		
		System.out.format("In 5 years you will be %d.\n", age+5);
		
		System.out.format("My favorite double is %f." ,favorite /2);
	}
}
